<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数组的遍历</title>
</head>

<body>

</body>

</html>
<script>
    /*
    数组的遍历可以考虑使用for循环或while循环
    */

    // for循环
    var arr = ['a', 'b', 'c', 'd', 'e'];

    for (var i = 0; i < arr.length; i++) {
        console.log(arr[i]);
    }

    //while 循环
    // var a = 0;
    // while(a < arr.length){
    //     console.log(arr[a]);
    //     a++;
    // }

    //for....in 遍历数组
    // for(var i in arr){
    //     console.log(arr[i]);
    // }


</script>